Raw wild crude produced from wells typically consist of a mixture of gas, liquid hydrocarbons, and salty formation water. In the upstream section of oil and gas industries, the function of a GOSP is to adequately separate gas and salty water from the crude oil to acceptable specifications for easy transportation and for downstream processing. For instance, excessive salt and water in crude oil from GOSP may result in high corrosion in transportation pipeline and refining units and may also have detrimental scaling effects on processing units and on catalysts. As part of the GOSP operation, produced crude oil is separated from associated salty water in a wet crude handling facility (WCHF) comprising of mainly crude dehydrator and desalter vessels. The salty water produced along with the crude often form very tight emulsion with oil that usually require use of demulsifier chemical and wash water to achieve the required specifications. Produced crude oil from most GOSPs must meet basic sediment and water (BS&W) specification of 0.2 v/v % and salt content of less than 10 PTB (pounds per thousand barrels) to be acceptable to most international crude buyers. Currently, in most GOSPs these crude product specifications are monitored manually and periodically determined through laboratory analysis at every 8-hour shift intervals. Similarly, the control of demulsifier and wash water injection rates are presently by manually adjusting the injection pumps strokes at the field.